home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 May: Tool Chest / Developer CD Series Tool Chest (Apple Computer)(May 1999).iso / Tool Chest / Development Kits / MPW Related / DTS MPW Goodies / GetLastChange < prev    next >
Encoding:
Text File  |  1990-09-14  |  1.4 KB  |  47 lines  |  [TEXT/MPS ]

  1. #
  2. #    File:        GetLastChange
  3. #
  4. #    Contains:    script to find the previous change in a window
  5. #
  6. #    Usage:        GetLastChange window commentFile [markCharacter]
  7. #
  8. #                    0        found a change
  9. #                    1        did not find a change
  10. #
  11. #                GetLastChange extracts a change from the window into the file,
  12. #                commentFile. The change is found by looking for the Change History
  13. #                text. The change must be marked with the markCharacter.
  14. #                The script leaves the entire change line selected.
  15. #
  16. #    Written by:    Darin Adler
  17. #
  18. #    Copyright:    © 1988, 1989 by Apple Computer, Inc., all rights reserved.
  19. #
  20. #    Change History:
  21. #
  22. #        11/17/89    dba        get rid of EndOfLine problem
  23. #        11/17/89    dba        use UnwrapCommentText to extract a (potentially long) comment;
  24. #                            WrapCommentText will re-wrap it
  25. #        11/15/89    dba        leave the comment file alone if there is no change history found
  26. #        11/13/89    dba        fix bug with files that have no line header character
  27. #        11/9/89        dba        stopped using LastChange marker; invented mark character
  28. #
  29. #    To Do:
  30. #
  31.  
  32. Set Exit 0
  33.  
  34. Set Window "{1}"                    # get change from this file (must be open window)
  35.  
  36. Set UpToComment /Change History:[ ∂t]*∂n(?«0,1»[ ∂t]*∂n)«0,1»?«0,1»∂t{3}∂t+[¬∂n∂t]+∂t+[¬∂n∂t]+∂t+/Δ
  37. Set Comment /≈(∂n?«0,1»∂t∂t∂t≈)*∞/
  38.  
  39. Find • "{Window}"
  40. Find {UpToComment}:{Comment} "{Window}"
  41. Set FindStatus {Status}
  42. If {FindStatus} == 0
  43.     UnwrapCommentText < "{Window}.§" > "{2}"
  44.     Find §:\•\:/∂n/ "{Window}"
  45. End
  46. Exit {FindStatus}
  47.